FORT    = gfortran
FOPTS   = -O3 -march=native -ffast-math -funroll-loops -fstrict-aliasing -cpp -Wunused

FORTRIX = ../..
LIBS = -L$(FORTRIX)/lib/ -lfortrix -L/usr/local/cuda/lib64 -lcudart -lcublas

all: unifac

clean:
	rm -rf *.o
	rm -rf *.mod
	rm -rf unifac

unifac: unifac.o
	$(FORT) $(FOPTS) -o $@ $< $(LIBS)

unifac.o: unifac.f90 mTypes.o
	$(FORT) $(FOPTS) -c -I$(FORTRIX)/include -o $@ $<

mTypes.o: mTypes.f90
	$(FORT) $(FOPTS) -c -o $@ $<

